#pragma once 
#include<stdio.h>
#include<fcntl.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>

#define NONE_FLUSH 1 << 0
#define LINE_FLUSH 1 << 2
#define FULL_FLUSH 1 << 3


#define MAX_BUFFER 256

typedef struct my_file
{
    int flag; //the refreshing method
    int fileno; //the file descriptor
    char outbuffer[MAX_BUFFER];
    int bufferSize;

}my_file;


my_file* MyFopen(const char* path , const char* mode);

size_t MyWrite(const void* ptr , size_t num , my_file* pfile);

void MyFflush(my_file* pfile);

void MyFclose(my_file* pfile);

